<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "article_keyword".
 *
 * @property integer $aid
 * @property integer $kid
 *
 * @property Article $a
 * @property Keyword $k
 */
class ArticleKeyword extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'article_keyword';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['aid', 'kid'], 'integer']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'aid' => 'Aid',
            'kid' => 'Kid',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getA()
    {
        return $this->hasOne(Article::className(), ['id' => 'aid']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getK()
    {
        return $this->hasOne(Keyword::className(), ['id' => 'kid']);
    }
}
